"use strict";

module.exports = formatPath;
const path = require("path");

function formatPath(p) {
  if (p && typeof p === "string") {
    // sep分隔符， window上表现为 ‘\’  ，macOS上是 ‘/’
    const sep = path.sep;
    if (sep === `/`) {
      return p;
    } else {
      return p.replaceAll(/\\/g, "/");
    }
  }

  return p;
}
